<?php
$pagename= "Data Entry- Books";

//this clears all veribles to prevent errors later




if (isset($_GET['status'])) {
$code= $_GET["barcode"];
echo "Form Processing...<br>Done!";
if ($_GET['status'] == "added") {
echo "<h3><font color='green'>SUCCESS! Write this Down: <b>Barcode:</font><font color='white'><i>";
echo $code;
echo "</i> </font><font color='green'>Call Number:</font><font color='white'><i>";
echo $_GET['callnum'];
echo "</i></font></h3>";
}
if ($_GET['status'] == "notfilled") {
echo "<h3><font color='red'>Please Try Again- ALL FEILDS REQUIRED</font></h3>";
}
}
	
		?>
		
<html>
<head>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script>

<script>
var $input = $('input:text'),
    $register = $('#register');

$register.attr('disabled', true);
$input.keyup(function() {
    var trigger = false;
    $input.each(function() {
        if (!$(this).val()) {
            trigger = true;
        }
    });
    trigger ? $register.attr('disabled', true) : $register.removeAttr('disabled');
});
</script>
</head>
<body>
<h4>ISBN FINDER- BOOKS ONLY!</h4><br>
<form method="post" action="?p=bookman/addbook2.php">
ISBN: <input type="text" id="name"size="11" name="query"/><br>
<input type="submit" value="Retrive Info!"/>
</form>
<h4>Everything Else!</h4>
<form method="get" action="bookman/addbook_go.php" >

Book Name <input type="text" id="name"size="80" name="bookname"/><br>
Author Last Name <input type="text" id="auth1" size="80" name="authlast"/><br>

Author First Name <input type="text" id="auth2" size="80" name="authfirst"/><br>

Publisher <input type="text" id="pub"size="80" name="publisher"/><br>

Year of Publication (ex. 1990) <input type="text" id="year" size="4" name="yearpub"/><br>

ISBN-10 (BOOKS ONLY NO DASHES!) <input type="text" id="isbn" size="30" name="isbn"/><br>

Edition ("1" if it can not be found):<input type="text" id="year" size="4" name="edition"/><br>

Dewey Decimal / Call Number  <input type="text" id="gen" size="80" name="call"/><br>
 
Fiction, Non-Fiction or N/A?
<select name="fiction">
<option value="true">Fiction</option>
<option value="false">Non-Fiction</option>
<option value="null">N/A</option>
</select><br>
Media Typer
<select name="media">
<option value="book">Book</option>
<option value="cd">CD</option>
<option value="dvd">DVD</option>
<option value="vhs">VHS</option>
<option value="other">Other</option>
</select><br>
In House Use Only: Yes <input type="radio" name="inhouse" value="true" /> No <input type="radio" name="inhouse" value="false" checked="checked" />  <br>

Timestamp <font color='red'>DO NOT EDIT</font>: <input type='text' value='<?php echo time(); ?>' name='time' hidden/>
<input type="submit" id="register" value="Register" />
</form>


</body>
</html>